cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BenDonahue
Continued Contributor
Continued Contributor

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
Continued Contributor
Continued Contributor

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

BenDonahue
Continued Contributor
Continued Contributor

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (20,876)