cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Button to update Data Card Value (Drop down choices)

The picture below showed how is the app looked like;


I have a data card with two options - Online & Offline. 

 

Georgetown15x_2-1605854855317.png

 

The data setup behind the scene:

Georgetown15x_0-1605855304890.png

 

 

What I am trying to achieve here:

 

Georgetown15x_1-1605854797554.png

 

when I click on "30 mins" button, the online status will change from "Online" to "Offline"

 

I have no ideas where to start from. The code below doesn't work;

 

 

UpdateContext({DataCardValue1:"Offline"});SubmitForm(EditForm1);

 

 

 

 


Can someone please advise and help me. Thanks.

1 REPLY 1
Highlighted
Community Support
Community Support

Hi @Georgetown15x :

Because Yes/No type is a special data type, it cannot be updated by hard coding. You need to obtain the values of the two options of this field through the two formulas 

First(Choices('Online (Boffffs)'))
/*Boffffs is my entitiy*/
/*you can get Choices(xxxx) in the combox's items property*/

and 

Last(Choices('Online (Boffffs)'))

respectively.

Please try this solution:

1\Set the app's OnStart property to

Set(TheVar,Blank()) /*TheVar is my variable*/

2\Set '30min''s OnSelect property to

Set(TheVar,First(Choices('Online (Boffffs)')));
ResetForm(Form1);
SubmitForm(Form1);
Set(TheVar,Blank())

3\Set the combobox(DataCardValue1)'s DefaultSelectedItems property to

If(IsBlank(TheVar),[Parent.Default],TheVar)

1.JPG

102.gif

Best Regards,

Bof

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,358)