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

Checkbox not patching sharepoint list.

Hi there,

 

I have been trying to get a checkbox to change a field "Acknowledged" to "Yes".  I have been looking at This link but just cannot figure it out.  

 

I have a gallery named (Gallery2) with a checkbox, which is currently set:

 

 

OnCheck: Patch('RoomDamageApp - Room Damage', Defaults('RoomDamageApp - Room Damage'), Gallery2.Selected, {Acknowledged: "Yes"})

 

I get this issue warning:

The type of this argument 'Acknowledged' does not match the expected type 'Boolean'. Found type 'Text'.

Any tips would be super. 


Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
LouisC
Level 8

Re: Checkbox not patching sharepoint list.

Hi @Joko,

 

I advise you not to use a CheckBox in your gallery : I tryed it and got a big loop bug...

My source Liste_Test have a column TestOuiNon

 

Look how I did it ->Appli.PNG In my gallery I put a button with these statements

.Text : If(ThisItem.TestOuiNon;"Activé";"Désactivé")
If(ThisItem.TestOuiNon=true;
    Patch(Liste_Test;ThisItem;{TestOuiNon:false});
    Patch(Liste_Test;ThisItem;{TestOuiNon:true})
)

I hope I helped you Smiley Happy

 

Regards,

 

Louis

8 REPLIES 8
LouisC
Level 8

Re: Checkbox not patching sharepoint list.

Hi @Joko,

 

Following your error, the problem is the type of your variable.

In don't know your data source but your column Acknowledged is waiting for a boolean type.

The value "Yes" you want to set on the column is flase --> it's a text type

Boolean values are : {true, false}

 

You can try then with  :

OnCheck: Patch('RoomDamageApp - Room Damage', Defaults('RoomDamageApp - Room Damage'), Gallery2.Selected, {Acknowledged: true})

Try it and tell me

 

Best regards,

Louis

Joko
Level: Powered On

Re: Checkbox not patching sharepoint list.

Ohhh, what a silly mistake to miss haha.  

 

Thanks for that.  However the problem i have now is, it is creating a new entry rather than updating the exiting record i am updating.  Is it my patch rule?

 

Thanks.

LouisC
Level 8

Re: Checkbox not patching sharepoint list.

@Joko,

 

What do you want exactly ? Update informations of an existing data or create a new data ?

 

Regards,

 

Louis

Joko
Level: Powered On

Re: Checkbox not patching sharepoint list.

So i have these records:

Do you see that its adding the YES/NO to a new entry/line rather than editing the one with information already there?

 

I am ticking the box within a Gallery.


Thanks.

 

1111.PNG

xzDan
Level 8

Re: Checkbox not patching sharepoint list.

Defaults(Source) will create a new record.

 

Try doing something like

Patch(<Source>,Id=Gallery2.Selected.Id, {Edits})
LouisC
Level 8

Re: Checkbox not patching sharepoint list.

Hi @Joko,

 

I advise you not to use a CheckBox in your gallery : I tryed it and got a big loop bug...

My source Liste_Test have a column TestOuiNon

 

Look how I did it ->Appli.PNG In my gallery I put a button with these statements

.Text : If(ThisItem.TestOuiNon;"Activé";"Désactivé")
If(ThisItem.TestOuiNon=true;
    Patch(Liste_Test;ThisItem;{TestOuiNon:false});
    Patch(Liste_Test;ThisItem;{TestOuiNon:true})
)

I hope I helped you Smiley Happy

 

Regards,

 

Louis

Joko
Level: Powered On

Re: Checkbox not patching sharepoint list.

This worked a treat for me!


Thank you very much! 

 

On the back of this, do you know if you can make Gallerys show new records at the top? Rather than old > new.


Thanks.

LouisC
Level 8

Re: Checkbox not patching sharepoint list.

You can just set your statement 'Items' of the gallery to :
SortByColumns(Filter(Liste_Test; StartsWith(Title; TextSearchBox1.Text)); "Created"; Descending)

if you wanna filter your source with the search box, and 
SortByColumns(Liste_Test; "Created"; Descending)

if you don't

 

Best regards Smiley Happy

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 182 members 5,049 guests
Please welcome our newest community members: