cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BenDonahue
Skilled Sharer
Skilled Sharer

Post data from a multi-select drop-down to a SharePoint list

I am gathering data into a SharePoint list.

Some options are multi-select drop-downs.

The form I am using is necessarily split between 25 pages. 

This is a door-to-door COVID survey, and I want to ensure that no data is lost, so I am saving all data to both the collection and to a local file.

I need to do three things with the data:

On navigating away from every page of the survey that has questions,

1. Save that page's data to a collection, and ...

2. Save the data to a local file.

2. On pressing the Upload button at the end of the survey, all data is to be posted to the SharePoint list. Because some surveys might have been done offline, there may be more than one record to upload. All records saved to the local the file are uploaded to the SharePoint list; as you have intuited, this app will need to run offline, thus the use of the local file, ... or that's what I learned yesterday, anyway.

My question is, what is the correct syntax for saving this data, page by page, to the collection? 

In the spirit of helping the community, I will add what I have learned, so far:

Checkbox values need to have single quotes areound the column name:

'columnName': 'checkBoxCardName'.Value    

Single-select drop-down value:

ColumnName: DataCardName.Selected.Value

LanguageIssue: DataCardValue58.Selected.Value

And that's about it for what I have had success with; when it comes to text and multi select data entries, I have not been able to find the solution I need.

 

The question:

How to I correctly save data from a question in a form that has been split to two of more pages to both the local collection and the local file?
Her is what I have:
Collect(colCovidTeamSavedItems,{'PreviousCOVIDIsolateSafely': DataCardValue104.Selected.Value });
SaveData(colCovidTeamSavedItems, "CovidTeamSavedItems")

And, if that looks right, here is the code that is not working for my "Single line of text" fields:
StreetAddress: DataCardValue48.Text  

Also, this does not work:

StreetAddress: {Value: DataCardValue48.Text} 

Neither of the above formulas are flagged  by Power Apps, but their functionality is wanting.

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @BenDonahue ,

 

Do you want to know how to save the data, page by page, to the only one record in Collection?

My idea is to append the data of the current Form page to the same record each time before navigating away the page. For instance.

In the OnHidden property of the first page, use the following formula to create a new record in the collection and save it locally.

 

Collect(colCovidTeamSavedItems,{'PreviousCOVIDIsolateSafely': DataCardValue104.Selected.Value });
SaveData(colCovidTeamSavedItems, "CovidTeamSavedItems")

 

In the OnVisible property of the second page, use the following formula to load the local file into the collection for offline functionality.

 

ClearCollect(colCovidTeamSavedItems,LoadData("CovidTeamSavedItems"))

 

In the OnHidden property of the second page, use the following formula to save the Form data to the same record as the first form, which can be looked up by GUID such as Identify ID.

 

Patch(colCovidTeamSavedItems,LookUp(colCovidTeamSavedItems,'Identify ID'= IdentifyDataCardValue.Text),{'Column Name': DataCardValue.Selected.Value });
SaveData(colCovidTeamSavedItems, "CovidTeamSavedItems")

 

 

With regard to your next question, are you asking the DataCardValue48.Text can be saved to the collection or the collection data can't be saved to SharePoint list? Please elaborate on it.

Best Regards,

Sik

View solution in original post

4 REPLIES 4
v-siky-msft
Community Support
Community Support

Hi @BenDonahue ,

 

Do you want to know how to save the data, page by page, to the only one record in Collection?

My idea is to append the data of the current Form page to the same record each time before navigating away the page. For instance.

In the OnHidden property of the first page, use the following formula to create a new record in the collection and save it locally.

 

Collect(colCovidTeamSavedItems,{'PreviousCOVIDIsolateSafely': DataCardValue104.Selected.Value });
SaveData(colCovidTeamSavedItems, "CovidTeamSavedItems")

 

In the OnVisible property of the second page, use the following formula to load the local file into the collection for offline functionality.

 

ClearCollect(colCovidTeamSavedItems,LoadData("CovidTeamSavedItems"))

 

In the OnHidden property of the second page, use the following formula to save the Form data to the same record as the first form, which can be looked up by GUID such as Identify ID.

 

Patch(colCovidTeamSavedItems,LookUp(colCovidTeamSavedItems,'Identify ID'= IdentifyDataCardValue.Text),{'Column Name': DataCardValue.Selected.Value });
SaveData(colCovidTeamSavedItems, "CovidTeamSavedItems")

 

 

With regard to your next question, are you asking the DataCardValue48.Text can be saved to the collection or the collection data can't be saved to SharePoint list? Please elaborate on it.

Best Regards,

Sik

View solution in original post

BenDonahue
Skilled Sharer
Skilled Sharer

I figured out my issue with the StreetAddress; it was something really dumb, ilike forgetting the .Text.

As for the other solution you provided, I think it is genius. I have one question, though; where does this value come from, 

'Identify ID'= IdentifyDataCardValue.Text

?

And finally, if a dropdown is multi-select, how do I reference those values for later use?

 

Thank you!

v-siky-msft
Community Support
Community Support

Hi @BenDonahue ,

 

IdentifyID is the field that stores the unique identifier of the record which should have been saved into the last record of collection in the first page, so I think we can use Last(colCovidTeamSavedItems) to retrieve that record that need to patch.

 

 OnHidden property of the second page:

Patch(colCovidTeamSavedItems,Last(colCovidTeamSavedItems),{'Column Name': DataCardValue.Selected.Value });
SaveData(colCovidTeamSavedItems, "CovidTeamSavedItems")

 

With regard to the last problem, what is the date type of dropdown field? If it's a Choices column with multiple selections and the items of combo box is Choices('SP list'.'ChoicesColumn'), please try to save the ComboboName.SelectedItems to Collection field as follow, and then you can patch the field to sharepoint directly.

 

Patch(colCovidTeamSavedItems,Last(colCovidTeamSavedItems),{'ChoiceColumn': ComboboName.SelectedItems });

 

Hope this helps.

Sik

That is a great approach, and I am doing that ad a part of the commands in the "Next" button, but OnVisible and OnHidden makes for a better place to do these kinds of things.

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,888)