Sharepoint update field based on lookup - sharepoint-online

I have a Sharepoint online list "myList" with fields PersonName, OriginCountry and OriginCity and another list of countries and cities called "WorldList" with columns Country and City.
In myList the user will select their city using a lookup to Worldlist. I want the country field to update based on what is entered into the city field.
What's the best way to do this?
I would like to do this without a webPart, Powerapp or Flow, but will use them if necessary. I would prefer to use a Flow rather than a Powerapp or webpart.

When you set the OriginCity lookup column in myList from WorldList, please add an additional column country as shown below:
If you don’t want to show the additional column in list view, you can hide the column.
Then create a flow to update the OriginCountry value using the additional column "OriginCity:Country":
Simple test for your reference:
-------------------------Update----------------------------------
Note, exclude OriginCountry ID, other columns will use the property under "when you created or modified the item" option.

Related

How do I use a power apps form for a lookup column?

I have a SharePoint List (say "List-A") with plenty of columns, some of which are lookup columns.
These are just used to construct a choice columns, where the items in the choice drop down are the items of a column in a different List ("List-B").
I have used the function on SharePoint to integrate List-A with Power Apps Form. This creates a Power Apps form that is readily available.
For the Lookup choice columns, I have added List-B as the data source, and am using the items from the correct column as items in the choice that is linked to the lookup column. This correctly populates the drop down menu as expected.
Now when I publish this form and fill it from sharepoint (it pops up as it should hafter clicking New in the List view) I can fill the entire form and submit with no issue. However all the lookup columns remain blank, as if the form returned a null value instead of the selected.
I have both datasources set up:
The update property of the datacard connecting to the SharePoint List is equal to the Selected of the datacard containing the combobox (combobox is called DataCardValue43).
The items property of the combobox is equal to the correct column of List-B.
As an alternative solution, I have attempted to make a different column that is just one line of text. For this column, I have made a combobox once again setting the items property to the column in List-B. The intention was to return the selected value as a string. It was attempted thus:
where combobox1 once again manages to give the correct options in the drop down box but returns only Null.
To study it further, I have made a power apps flow that takes Create New Sharepoint List object as input. Here I see that the values are indeed Null
The one called "Return" is the text column that I made, and the other being the lookup column. I do notice that the Lookup column isn't called Value, but id. I don't know what to do with that information though.
I really just want to have a column in my power apps form that lets you choose and the choices are values from a column in a different List. What do I do, and why doesn't what I've already done work?
Thank you.
Please follow the steps below to solve the issue.
1: Add a Lookup column in SharePoint List.
2: Open that list in Power Apps by using the Customise Forms Option From SharePoint.
3: The Item property of Lookup field will be by default as follow:
Choices([#'CustomisingSharePointList'].LookupColumnListName)
4: There is no need to change/delete the lookup field with any custom dropdown or combo box. This is the point, where you are doing mistake by adding a custom combobox and replacing the original Lookup dropdown. If you want to change datasource, apply filter or sort the data, you can do all these thing to the same original lookup column.
e.g I have applied filter and sort functions to the existing data:
Sort(Filter(Choices([#'CustomisingSharePointList'].'LookupColumnListName'), Value in Filter(LookupColumnListDataSoure,Progress.Value = "Open").ID),Id)
5: When you will publish the list, it will work fine.
Note:
CustomisingSharePointList: List in which we have added a lookup column.
LookupColumnListName: List to which the lookup column actually belongs to.
LookupColumnListDataSoure: You need to add the original list as data source in power apps to use the above filter. This step is optional and applicable only if you apply filter like I did in step 4

Microsoft Powerapps - How to connect to different datasource in one form

I'm building an app for TravelInfo. Here are the fields: From, To, City, Country.
I am using common data source entity. And for the country lookup, I want to use a sharepoint list, that has all the country names.
I'm stuck at this stage. As you see in the snap, I want to connect the country dropdown to a sharepoint list.
[I've tried to achieve the same with picklist. But Its not good to manually create the huge list of countries in picklist. Sharepoint list should be ideal.]
Here is the question: In one form, how can I use different datasource for different fields??? Please help.
A form will save the data card value defined in Update into the field defined by DataField. You are trying to change data displayed on the dropdown which is not set in the Fields list you have above. Try the following (the first few steps may already be completed based on picture):
Check Country to insert data card into form
Select data card and under Advanced properties click Unlock to change properties
Delete text box from data card that was added by default
Select data card and insert desired control (drop down box)
Select drop down box (not data card) and under Advanced properties define Items and Value to populate values from the sharepoint list
Select data card and change Update to desired dropdown value that should be saved e.g. dropDown1.Selected.country_id
The drop down box can display the Country text on the form, but then save an associated value such as the country id.

Populate sharepoint list column based on another column value

I have a SharePoint 2010 List with two columns, State and City. State is populated with a list of states while City is populated with a list of cities. The City list also has a State column. I want to filter the City list according to the selected state. How can I achieve this without using InfoPath, SharePoint Designer or a web part. I want to do it only in SharePoint. Is that possible to give a message when they select the city stating "Please select State before selecting a City"? If any JQuery or JavaScript will be used then how can I use that.
Use Managed Metadata instead. Create a tree with the states and the cities and then add that as a column instead.
http://www.sharepointnutsandbolts.com/2009/12/managed-metadata-in-sharepoint-2010-key.html
You can use JavaScript, but to do it you need either Sharepoint Designer or a web part .... So in JavaScript you could use SPService or SPJS

Is it possible to create a Custom Column that will take values from a specific view of a list?

I have a list of products that has two columns, product and product family.
I want to create another list that uses this first list as a lookup for one of the columns. This I can do, i.e. I create a custom column and then use the "Add from existing site columns" linko the "List Settings" page of the second list.
However, what I'd really like is that the custom column only proposes products that belong to a specific product family. I can create a View in the first list which allows me to display only the products in a specific family. However I don't see any way to specify only this view when I create the custom column.
Anyone have any ideas ?
Best regards,
Colm
If I understood you correctly you are trying to make a dynamic select field that will populate based on what the user has chosen in a select field before it. You will not be able to configure this with out of the box SharePoint. It is possible to add some javascript to a form to achieve this. I believe you can also do this in InfoPath but I am double checking that.

Create a mailto: hyperlink column using a Person column and another column in SharePoint

In a SharePoint calendar list, I have a Title column (single line of text) and a Contact column (person or group).
What I would like to do is create a custom field for a RSVP link. The link would be a "mailto:" url using the Contact column's email address and the Title column's value for the subject. For example: mailto:someone#xyz.com?subject=thetitle. The link would be shown in Display view of the event item.
Is this possible? How would I be able to go about doing this?
[Added Question]
Could this be done using a computed field or custom field? If so, how?
Have you look at calculated fields? I think that it should be doable using the CONCATENATE function.

Resources