cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vetri_V
Frequent Visitor

Issue in saving Gallery items to SharePoint list

I am getting the blank values in all the gallery controls (Text boxes and dropdown). The rows are getting inserted in SharePoint as blank.

 

Vetri_V_0-1670594383726.png

 

Vetri_V_1-1670594403714.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
cha_cha
Super User
Super User

Hello @Vetri_V 

 

I tried replicating your setup and working on a short demo to solve your issue. The reason why it's not working is the controls (highlighted in red) you are using will always be empty outside the Gallery control. You need a way to see the data and the best method would be using a collection. 

cha_cha_0-1670683393376.png

 

This is just a short 10-minute demo on how you can approach this.

https://youtu.be/LNz5FwBmWD0

 

OnStart:

ClearCollect(colABC, {Title:"", Lot_Number:"", Nr_Packs: "", Actual_Weight: "", Sealed: {Value:""}});

+ icon

Collect(colABC, {Title:"", Lot_Number:"", Nr_Packs: "", Actual_Weight: "", Sealed: {Value:""}});

Trash icon 

Remove(colABC,ThisItem)

 

Add Button

ForAll(
    addLogistics.AllItems,
    Patch(Logistics,
    {
        Title: "ABC",
        Lot_Number: ThisRecord.Lot_Number,
        NrPacks: ThisRecord.Nr_Packs,
        'Actual Weight': ThisRecord.Actual_Weight,
        Sealed: ThisRecord.Sealed
    }
    )
);

Clear(colABC);

 

The OnChange Codes:

Lot: Patch(colABC,ThisItem,{Lot_Number: Self.Text})

NR: Patch(colABC,ThisItem,{Nr_Packs: Self.Text})

Weight: Patch(colABC,ThisItem,{Actual_Weight: Self.Text})

Sealed: Patch(colABC,ThisItem,{Sealed: {Value: Self.Selected.Value}})

 

Sealed.Items: Choices([@Logistics].Sealed)

 


  ✔️
Just in case my response helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 

  🔗
🕸bistek.space  🐦 @cha_bistek  📺 @BisTekSpace 

 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @charv3n    @BisTekSpace 

View solution in original post

9 REPLIES 9
KeithAtherton
Super User
Super User

Hi @Vetri_V,

 

If you select some of the fields values like txtLotNumber.Text in the formula bar, are non-blank values shown?


If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

LaurensM
Super User
Super User

@Vetri_V are the fields in SP defined as number fields?

In that case try wrapping Value() around the Textfields.

For Sealed try and replace Sealed: ddSealed.Selected, with:

 

Sealed: {Value: ddSealed.Selected.Value}

 

 

I hope this helps!

Good question. Here are few screenshots.

Values entered in Gallery

Vetri_V_0-1670677858370.png

Formula bar

Vetri_V_1-1670678006875.pngVetri_V_2-1670678833473.png

 

KeithAtherton
Super User
Super User

Thanks @Vetri_V. I would expect txtLotNumber.Text to show data "23r23" instead of Blank.

 

Could it be that the Lot Number text box is called something other than txtLotNumber?

 

If you select the text input, what is the name of the control in the properties pane?


If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thank you for the prompt response. Here is the screenshot.

Vetri_V_0-1670679854179.png

 

KeithAtherton
Super User
Super User

Thanks @Vetri_V. That screenshot helps because we can see that the text input is indeed the txtLotNumber control.

 

Also, that text input control is inside of a gallery (addLogistics), and there may be multiple records within the gallery which may explain why we see Blank when selecting the control in the formula bar.

 

The code you initially posted looks fine so not sure why it's not working. Another test to try would be to save the addLogistics.AllItems to a collection first then view the collection data in the formula bar to see if the data shows as expected.

 

Also, there are similar posts online where people are experiencing a similar issue, I hope they can help: https://powerusers.microsoft.com/t5/Building-Power-Apps/Patch-all-items-in-Gallery/td-p/66288


If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

cha_cha
Super User
Super User

Hello @Vetri_V 

 

I tried replicating your setup and working on a short demo to solve your issue. The reason why it's not working is the controls (highlighted in red) you are using will always be empty outside the Gallery control. You need a way to see the data and the best method would be using a collection. 

cha_cha_0-1670683393376.png

 

This is just a short 10-minute demo on how you can approach this.

https://youtu.be/LNz5FwBmWD0

 

OnStart:

ClearCollect(colABC, {Title:"", Lot_Number:"", Nr_Packs: "", Actual_Weight: "", Sealed: {Value:""}});

+ icon

Collect(colABC, {Title:"", Lot_Number:"", Nr_Packs: "", Actual_Weight: "", Sealed: {Value:""}});

Trash icon 

Remove(colABC,ThisItem)

 

Add Button

ForAll(
    addLogistics.AllItems,
    Patch(Logistics,
    {
        Title: "ABC",
        Lot_Number: ThisRecord.Lot_Number,
        NrPacks: ThisRecord.Nr_Packs,
        'Actual Weight': ThisRecord.Actual_Weight,
        Sealed: ThisRecord.Sealed
    }
    )
);

Clear(colABC);

 

The OnChange Codes:

Lot: Patch(colABC,ThisItem,{Lot_Number: Self.Text})

NR: Patch(colABC,ThisItem,{Nr_Packs: Self.Text})

Weight: Patch(colABC,ThisItem,{Actual_Weight: Self.Text})

Sealed: Patch(colABC,ThisItem,{Sealed: {Value: Self.Selected.Value}})

 

Sealed.Items: Choices([@Logistics].Sealed)

 


  ✔️
Just in case my response helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 

  🔗
🕸bistek.space  🐦 @cha_bistek  📺 @BisTekSpace 

 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @charv3n    @BisTekSpace 

Perfect! This is what I tried few minutes back and it worked. Thank you!

cha_cha
Super User
Super User

Glad you got it sorted.


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @charv3n    @BisTekSpace 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,566)