Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Unanswered

Set default value for column collection

Posted on 1 Dec 2024 15:38:13 by 28
Hi,
 
 
I have the collection as below picture, Material, Lot and Expiry Date are taken from splitting the QR Code column. I have problem with saving the data for these three column Material, Lot and Expiry Date collection.
 
 
 
 
 
 
The Default tab of Material column is below picture, and I put onchange value also.
 
 
But that value is not taken to collection. Please help me fix this.
 
 
  • WarrenBelz Profile Picture
    WarrenBelz 143,202 on 01 Dec 2024 at 21:11:50
    Set default value for column collection
    Hi @MaiLe
    Firstly you have four values in there and have only stated three fields, but you will get the idea from the code below. Also that date is going to come out as a string and you will have some further complexity getting dd/mm/yyyy format back into a date field.
    With(
       {
          _Item:
          Split(
             ThisItem.QRCode,
             "#"
          )
       },   
       Patch(
          colRecord,
          ThisItem,
          {
             Material: First(_Item).Value,
             Lot: Index(_Item, 2).Value,
             ExpiryDate: Last(_Item).Value
          }
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    Buy me a coffee

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,202

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,877

Leaderboard