cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bubs
Level: Powered On

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
Super User
Super User

Re: Using patch when you do not have a data card value

Hi @bubs 

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
bubs
Level: Powered On

Re: Using patch when you do not have a data card value

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

Super User
Super User

Re: Using patch when you do not have a data card value

Hi @bubs 

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. 

bubs
Level: Powered On

Re: Using patch when you do not have a data card value

@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

Super User
Super User

Re: Using patch when you do not have a data card value

Hi @bubs 

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

bubs
Level: Powered On

Re: Using patch when you do not have a data card value

@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?

Super User
Super User

Re: Using patch when you do not have a data card value

Hi @bubs,

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,892)