cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NigelP
Level 8

Updating Items in A Gallery

HI

 

I know this is an old chestnut, but I cannot find an answer to it.

 

I have a gallery which is based upon a collection.

 

The GAllery has two fields a label and a Value.

 

I want to be able to update the Value in a particular Gallery Item without affecting the rest of the Gallery.

 

If the update of the Value in a particular GAllery Item results in an invalid item eg. It is supposed to be an email address and IsMatch(txtValue, Mail) returns false (invalid), how do I show that that value is invalid by say setting the colour of the text to RED ?

 

So GAllery is :-

Title1 - label

Value1 - email address

Title2 - label

Value2 - email address

 

and I want to set the colour of the text in Value2 to RED indicating it is invalid.

 

Thanks

 

Nigel

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Updating Items in A Gallery

Hi @NigelP,

Could you please share a screenshot about your Gallery?

How do you update the Value within your Gallery?

I have made a test on my side, please take a try with the following workaround:6.JPG

 

7.JPG

9.JPG

 

 

8.JPGWithin the Gallery, set the Default property of the Text Input box (on your side, it is Value box, e.g. Value1, Value2, ...) to following:

ThisItem.Value

Set the Color property of the Text Input box to following (set the color of the text to RED when the value is invalid):

If(IsMatch(TextInput1.Text, Match.Email), RGBA(0,0,0,1), RGBA(255, 0, 0, 1 ))

Or

If(IsMatch(ThisItem.Value, Match.Email), RGBA(0,0,0,1), RGBA(255, 0, 0, 1 ))

Add a "Save"/"Update" button within your Gallery, set the OnSelect property to following:

Patch(RecordsCollection,ThisItem,{Value: TextInput1.Text})

Please check the attached GIF screenshot for more details:

 

More details about the Patch function in PowerApps, please check the following article:

Patch functuion

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Community Support Team
Community Support Team

Re: Updating Items in A Gallery

Hi @NigelP,

Could you please share a screenshot about your Gallery?

How do you update the Value within your Gallery?

I have made a test on my side, please take a try with the following workaround:6.JPG

 

7.JPG

9.JPG

 

 

8.JPGWithin the Gallery, set the Default property of the Text Input box (on your side, it is Value box, e.g. Value1, Value2, ...) to following:

ThisItem.Value

Set the Color property of the Text Input box to following (set the color of the text to RED when the value is invalid):

If(IsMatch(TextInput1.Text, Match.Email), RGBA(0,0,0,1), RGBA(255, 0, 0, 1 ))

Or

If(IsMatch(ThisItem.Value, Match.Email), RGBA(0,0,0,1), RGBA(255, 0, 0, 1 ))

Add a "Save"/"Update" button within your Gallery, set the OnSelect property to following:

Patch(RecordsCollection,ThisItem,{Value: TextInput1.Text})

Please check the attached GIF screenshot for more details:

 

More details about the Patch function in PowerApps, please check the following article:

Patch functuion

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
NigelP
Level 8

Re: Updating Items in A Gallery

Hi Kris

 

That worked for me too.

 

Thanks

 

Nigel