cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Patron
Post Patron

Change Number to any other than default

I have populated numberfield1 from   numberfield2 by default using ThisItem.NumberField2.  I wish to change the Value to a number other than the default if I wish.  At the moment when I change the number it does not save and keeps defaulting back to numberfield2's value.

I'm sure its so simple but...

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @StuCundy ,

If you are Patching to a Numeric field, you need to send a numeric value. I am assuming your drop-down is a number - so

Patch(
   HostSearch,
   ThisItem, 
   {
      ThisGroupAllocatedStudentNo: 
      Value(Dropdown2.Selected.Value)
   }
)

Is this is issue?

View solution in original post

8 REPLIES 8
Super User III
Super User III

Hi @StuCundy ,

You can set the Default of a control conditionally - what do you need it set to?

Hi @WarrenBelz 

I first just entered in the default of "ThisGroupAllocatedStudentNo" ThisItem.HostVisitorNumberPref and tried to change the value but it would not save.

I have now entered the following in the default of ThisGroupAllocatedStudentNo but its not working either.

If(IsBlank(ThisItem.HostVisitorNumberPref),ThisItem.ThisGroupAllocatedStudentNo)

 

Thanks @StuCundy ,

What is the Update property of the card and is the value you require showing in it before saving?

Hi @WarrenBelz 

Its in a gallery.  I just inserted a text input called in default.  I guess it does not know what field it is until I tell it?

 

What I am trying to do is; I have hosts with a max number they can take.  ThisGroupAllocation field is either the number I will say they will get.  So I thought to start with the host max as a default.  Maybe I need to collect, add a column and then patch to the list with the allocated number?

Thanks @StuCundy ,

Yes - a gallery will not refresh until the data source it is based on does. If a list, then you have to refresh the List. A collection is a good idea, however unless you are patching to the collection, you will not see any change until you refresh the Data Source and re-collect.

You can still however have a conditional value in the Text of a gallery field, so you can either show the value in the base data (ThisItem.YourFieldName) or what ever you might want to display under another condition. Does this fit your needs?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @WarrenBelz 

So I need to edit the input text and make a save button to patch the result to the list.  If I make a dropdown with number choices and then patch that to the list direct using this

Patch(HostSearch,ThisItem, {ThisGroupAllocatedStudentNo: Dropdown2.Selected.Value})

 I get a number issue error

Hi @StuCundy ,

If you are Patching to a Numeric field, you need to send a numeric value. I am assuming your drop-down is a number - so

Patch(
   HostSearch,
   ThisItem, 
   {
      ThisGroupAllocatedStudentNo: 
      Value(Dropdown2.Selected.Value)
   }
)

Is this is issue?

View solution in original post

@WarrenBelz 

perfect, thank you.

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (27,032)