Hi All,
I am currently working on a kind of a tracker, which asks user for an input by selecting from available options. Please see the sample below which portrays what I am trying to achieve and my current stage.
The data source for the user form looks as follows:
The user form SharePoint list has the following structure:
Key columns in this exercise are:
Data types should remain as provided.
I have already built the user form in PowerApps, which looks as follows:
Everything works well when I am creating a new item – data is saved properly in the SharePoint list, for example:
A problem occurs when I am trying to edit the already existing item. It looks like the record values are loaded properly once I click on “Edit” (just like on the snip above). However, when I am trying to edit the “Visited Country” field, the result is not saved properly. For example, when I remove “Sweden” and “Netherlands” from the list, the field turns blank:
When I am adding a new entry, I get the following outcome:
Interestingly, if I remove all items in the edit mode and choose again, the result is saved properly:
It looks like the items that are already in the field are not treated as “selected” ones, despite being visible in the form upon clicking on the Edit button (the example, where “, , , Poland” saved back to SharePoint makes me think that these are loaded as blanks or nulls).
The form elements are configured in PowerApps as follows:
Properties of the “Visited Country” field (I am not showing how “Visited Continent” is configured as it works well)
Items property:
Filter(ContinentAndCountry, Continent = ddSelectedContinent.Selected.Result)
Update property:
If(
SharePointForm1.Mode = 1, // 0 - Edit, 1 - New, 2 - Display
Concat(cbSelectedCountry.SelectedItems, ThisRecord.Country, ", "),
If(
SharePointForm1.Mode = 0,
Concat(cbSelectedCountry.SelectedItems, ThisRecord.Country, ", ")
)
)
(The highlighted part serves as a placeholder here – my guess is that the solution can be placed here)
DefaultSelectedItems property:
RenameColumns(Split(Parent.Default, ", "), "Result", "Value")
Has anyone worked on a similar problem with Edit mode or knows what I am missing in the presented solution? I would appreciate any feedback - tips, suggestions are more than welcome.
Thanks,
Pawel
Solved! Go to Solution.
Hi @TheJM15 ,
This is due to the format of items and defaultselectedItems are different.
Please try this on defaultselectedItems attribute:
ForAll(Split(Parent.Default, ", ") As A,LookUp(ContinentAndCountry,Country=A.Result) )
Best Regards,
Wearsky
Hi @TheJM15 ,
This is due to the format of items and defaultselectedItems are different.
Please try this on defaultselectedItems attribute:
ForAll(Split(Parent.Default, ", ") As A,LookUp(ContinentAndCountry,Country=A.Result) )
Best Regards,
Wearsky
User | Count |
---|---|
258 | |
111 | |
95 | |
48 | |
41 |