cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Using patch when you do not have a data card value

Hello, 

 

I am tying to use a patch function to send my data to SP. One of my cards does does not have a data card value. It is used as a header and collects information with a function in update. What value would I assign to it so that information is able to get to SharePoint?

 

Let me know if you have any questions

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anonymous 

If you were referencing a label containing a value, you would have something like

Patch(DataSource,Defaults(DataSource),{ColumnName:Value(Label1.Text)})

If you were adding a new row to your table with the indicated value as the data point.  If you were modifying an existing row you would need to replace the Defaults(DataSource) with something like  Lookup(Datasource,ID = Gallery1.Selected.ID). 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

I tried doing 'PersonalAppearanceSection: true' in my patch, but it gave me the wrong value 

Hi @Anonymous 

Why not just add a label and have the patch capture the value of the label.  You could hide the label if you have its value displayed elsewheres.  A label will display text but can easily be converted to a number by wrapping it in the Value() function or simply multiplying it by 1. 

Anonymous
Not applicable

@Drrickryp 

I created the label and put my average function within the text property in a value(). For some reason though my patch keeps getting errors when I put in 'PersonalAppearanceSection : label' It just says unknown error

Hi @Anonymous 

If you were referencing a label containing a value, you would have something like

Patch(DataSource,Defaults(DataSource),{ColumnName:Value(Label1.Text)})

If you were adding a new row to your table with the indicated value as the data point.  If you were modifying an existing row you would need to replace the Defaults(DataSource) with something like  Lookup(Datasource,ID = Gallery1.Selected.ID). 

View solution in original post

Anonymous
Not applicable

@Drrickryp 

 

The Gallery is meant to display records that were saved offline in a collection, then the user can go back into the app when online, view their form and submit it. Would i still want to use the look up in this case?

Hi @Anonymous,

You need to modify the second element of Patch() function with a Lookup() only if the row (item) already exists in the DataSource.  If the Gallery is showing items that have not yet been loaded to the datasource, then the Patch would need to have Defaults() as the second item in order to add new records. 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,370)