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

patching.. help

HI

 

I cannot get it to patch selected data including attachment in the record?

 

I have a gallery that is pickup data from submitted forms, the category display is a selected choice in SP list.

 

onselect patch button - 

Patch('list', Defaults('list'), {Category :Category1.selected.value, Description:TextInputDes.Text}) or 

{Category :Category1.selected.Text 

 

 

also not working?

 

1.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @bbsin,

Sorry for the late reply, have you solved your problem?

If you just want to copy one record once you click the copy button in order to patch the selected record including the attachment, please try as below.

I'll consolidate all the information you gave me before and reproduce your process in full.

1).Make a Group by taking all the input controls within your pop-up window.

Select (Ctrl + Click) all the input controls those you want to make a Group. Click on 3 dot ellipses () and then Group as shown below.

v-qiaqi-msft_0-1621303436757.png

2). Select the group and set its Visible property as 

DisplayPopup // This is a variable

3). Set your  copy icon OnSelect property as

Set(DisplayPopup, true )

4). Set the Cancel button OnSelect property as

Set(DisplayPopup, false )

5). Set the OK button OnSelect property as

Patch(
    DefaultSelectedItem,
    Gallery8.Selected,
    {
        Title: TextInput7.Text,
        CH: {Value: TextInput8.Text}
    },
    EditForm2.Updates
);
Set(
    DisplayPopup,
    false
)

6). Set the Item property of the EditForm2 as

Gallery8.Selected

Note that EditForm2 is the FormEditQ in your scenario, CH is a Choice column in my SP list. Every time you select a record in the gallery, the FormEditQ will be populated with this selected record, and to meet your need that patch a attachment within the record, you could refer to the FormEditQ.Updates to catch the attachment.

Please check the attach Gif for details.

Regards,

Qi

 

Best Regards,
Qi

View solution in original post

9 REPLIES 9
v-qiaqi-msft
Community Support
Community Support

Hi @bbsin,

Based on the issue that you mentioned, do you want to patch a Dropdown selected item to a Choice field in SP list?

Could you please tell me that Category1 is a Dropdown or a Combo Box?

If Category1 is a Combo Box and the corresponding column is a Choice type, please consider modifying your formula as below:

Patch('list', Defaults('list'),{Category :{Value:Category1.Selected.Value}, Description:TextInputDes.Text})

Check if it could help you.

Regards,

Qi

Best Regards,
Qi
bbsin
Post Prodigy
Post Prodigy

hi @v-qiaqi-msft 

 

bbsin_0-1621234199126.png

 

the category is a text box in the gallery - thisitem.category.value

 

Hi @bbsin,

Do you mean that you want to patch the text box value to a Choice field in your SP list?

Could you please:

  1. share the specific error message?
  2. Tell me that how you set the Items property of the Gallery?
  3. Is there only one record in your Gallery?

I am so confused that what do you want to achieve? Since the Gallery fetch data from submitted forms, then the data within the Gallery should have been saved to SP list successfully already. Or if you want to create a duplicated table using all the records within the Gallery and patch the duplicated table to another list?

If you want to create a repeated table, please try as below:

ForAll(
    Gallery7.AllItems,
    Patch(
        SPList,
        Defaults(SPList),
        {
            Description: TextInputDes.Text,
            Category: {Value: TextInputCate.Text}
        }
    )
)

Note that TextInputCate is the text box corresponding to the Category in your Gallery.

If this formula could not solve your problem, please provide more details about your scenario because I could not imagine what you have met in your own scenario.

Regarda,

Qi

 

 

Best Regards,
Qi

hi v-qiaqi-msft,

 

yes, I want to duplicate the row of data , how to also patch the attachment that is in the record? or it cannot be done?

 

Also how to have the dialog box closed after it is submitted?  Thanks

Hi @bbsin,

Could you please answer my questions one by one instead of one of them?

Attachment control is supported in a Form rather than a Gallery, you could use the Form1.Updates to patch the attachment in a record. In a word, patch the attachment from the Gallery could not be achieved.

Have the dialog box closed after it is submitted, this is a new issue, please open a new case to post it.

Regards,

Qi

 

Best Regards,
Qi

Hi @v-qiaqi-msft 

 

1) the pop up is 

when user click the copy icon it will pop and show..   Onselect - Set(varSaveDiagBox,true)

and the ok will patch it after it patch, the popup did not go away.. how to make it go away and have a text successfully duplicate?

 

bbsin_0-1621238386585.png

 

 

  1. Tell me that how you set the Items property of the Gallery, there is a combserarch box on top of the gallery
  2. bbsin_2-1621238667388.png

     

    set - SortByColumns(
    Filter(
    'list',
    IsBlank(ComboBox1.Selected.Value) || IsEmpty(ComboBox1.Selected.Value) || Category.Value = ComboBox1.Selected.Value
    ),
    "ID",
    Descending
    )

     

as I need to sort by category

 

  1. Is there only one record in your Gallery?
    1. no there are many records in the gallery.

 

Also is there any way to patch the attachment inside the record too?? 

 

I have question, when I delete or patch.. the data running back end is slow.. is it back it's lots of data and it's not on collection??  anyway to make it faster??  Thanks

 

Hi v-qiaqi-msft,

 

Is it like that?

ForAll(
GalleryAll.AllItems,
Patch(
'list',
Defaults('list),FormEditQ.Updates,
{
Description: TextInputDes.Text,
Category: {Value: CategoryText.Text}
}
)
)

hi v-qiaqi-msft,

 

I just the for all.. it copy a few .. i just want to duplicate the selected record and it attachment in it.. one row at a time

 

Thx

Hi @bbsin,

Sorry for the late reply, have you solved your problem?

If you just want to copy one record once you click the copy button in order to patch the selected record including the attachment, please try as below.

I'll consolidate all the information you gave me before and reproduce your process in full.

1).Make a Group by taking all the input controls within your pop-up window.

Select (Ctrl + Click) all the input controls those you want to make a Group. Click on 3 dot ellipses () and then Group as shown below.

v-qiaqi-msft_0-1621303436757.png

2). Select the group and set its Visible property as 

DisplayPopup // This is a variable

3). Set your  copy icon OnSelect property as

Set(DisplayPopup, true )

4). Set the Cancel button OnSelect property as

Set(DisplayPopup, false )

5). Set the OK button OnSelect property as

Patch(
    DefaultSelectedItem,
    Gallery8.Selected,
    {
        Title: TextInput7.Text,
        CH: {Value: TextInput8.Text}
    },
    EditForm2.Updates
);
Set(
    DisplayPopup,
    false
)

6). Set the Item property of the EditForm2 as

Gallery8.Selected

Note that EditForm2 is the FormEditQ in your scenario, CH is a Choice column in my SP list. Every time you select a record in the gallery, the FormEditQ will be populated with this selected record, and to meet your need that patch a attachment within the record, you could refer to the FormEditQ.Updates to catch the attachment.

Please check the attach Gif for details.

Regards,

Qi

 

Best Regards,
Qi

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.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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 (4,369)