cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tupues
Helper III
Helper III

Patch text column from Dropdown Choices

Hi all,

 

I have a dropdown with the following items:

 

Items=SPInstructors.InstructorName

 

These Items are in form of text in the SPInstructors list

 

The choice of this dropdown now needs patched into another SP list named SPfeedback. The column it will be patched into is text as well. I have the following patch code:

 

Collect(
    col_Submit,
    {
        Title: "Comments",
        Answer: CommentsInput.Text,
        Instructor: box_Instructor.Selected,
        Session_detail: box_SessionDetail.Selected
    }
);
ForAll(
    col_Submit,
    Patch(
        SPfeedback,
        {
            Title: Title,
            Answer: Text(Answer),
            Stage: Text(First(Stage).Value),
            Session_Type: First(Session_Type).Value,
            Comment_Grade: Text(Comments_Grade),
            Session_detail: (Session_detail).Value,
            Instructor: (Instructor).Value
        }
));

 

The patch works fine without the last line ("Instructor: (Instructor).Value"). If I add the last line I get the error saying that it is not a record that I am putting in... any ideas where I went wrong? I think its because the dropdown is effectively a lookup from a SP list and thus the formatting might be erroneous..

 

Many thanks,

 

Tom

 

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks @tupues ,

If Session_Detail is working, I will leave it alone, but you are also getting a possible table here.

There are also other things possibly not needed (and you would normally have Defaults(SPFeedback) under the Patch table), but I have only changed your "problem" field here as you confirm the rest works. 

Collect(
    col_Submit,
    {
        Title: "Comments",
        Answer: CommentsInput.Text,
        Instructor: box_Instructor.Selected.InstructorName,
        Session_detail: box_SessionDetail.Selected
    }
);
ForAll(
    col_Submit,
    Patch(
        SPfeedback,
        {
            Title: Title,
            Answer: Text(Answer),
            Stage: Text(First(Stage).Value),
            Session_Type: First(Session_Type).Value,
            Comment_Grade: Text(Comments_Grade),
            Session_detail: (Session_detail).Value,
            Instructor: col_Submit.Instructor
        }
));

As an experiment, as all the columns line up,you might also try

Collect(
    col_Submit,
    {
        Title: "Comments",
        Answer: CommentsInput.Text,
        Instructor: box_Instructor.Selected.InstructorName,
        Session_detail: box_SessionDetail.Selected
    }
);
Collect(SPFeedback, col_Submit)

 

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.

 

View solution in original post

24 REPLIES 24
WarrenBelz
Super User III
Super User III

Hi @tupues ,

The issue is at the top - if you are wanting to collect text, then you need to specify this in the Collection. Note xxxx will depend on the Items of this control.

Collect(
    col_Submit,
    {
        Title: "Comments",
        Answer: CommentsInput.Text,
        Instructor: box_Instructor.Selected.InstructorName,
        Session_detail: box_SessionDetail.Selected.xxxx
    }
)

will get Text values. Before I look further at the Patch, are these new records to SPFeedback?

 

Thanks @WarrenBelz,

 

Yes these are new records. As mentioned all the others work without an issue, only that one dropdown is causing issues...

Thanks @tupues ,

If Session_Detail is working, I will leave it alone, but you are also getting a possible table here.

There are also other things possibly not needed (and you would normally have Defaults(SPFeedback) under the Patch table), but I have only changed your "problem" field here as you confirm the rest works. 

Collect(
    col_Submit,
    {
        Title: "Comments",
        Answer: CommentsInput.Text,
        Instructor: box_Instructor.Selected.InstructorName,
        Session_detail: box_SessionDetail.Selected
    }
);
ForAll(
    col_Submit,
    Patch(
        SPfeedback,
        {
            Title: Title,
            Answer: Text(Answer),
            Stage: Text(First(Stage).Value),
            Session_Type: First(Session_Type).Value,
            Comment_Grade: Text(Comments_Grade),
            Session_detail: (Session_detail).Value,
            Instructor: col_Submit.Instructor
        }
));

As an experiment, as all the columns line up,you might also try

Collect(
    col_Submit,
    {
        Title: "Comments",
        Answer: CommentsInput.Text,
        Instructor: box_Instructor.Selected.InstructorName,
        Session_detail: box_SessionDetail.Selected
    }
);
Collect(SPFeedback, col_Submit)

 

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.

 

View solution in original post

Thanks @WarrenBelz 

 

Tried the above. However if I add ".InstructorName" to 

Instructor: box_Instructor.Selected,

---->

Collect(
    col_Submit,
    {
        Title: "Comments",
        Answer: CommentsInput.Text,
        Instructor: box_Instructor.Selected.InstructorName,
        Session_detail: box_SessionDetail.Selected
    }
);

I am getting the "incompatible type" error saying that the "function collect has some invalid arguments"...

 

 

Thanks @tupues ,

Obviously I cannot see either your data or control specs, but you did say earlier that the drop down Items was 

SPInstructors.InstructorName

are we referring to the same drop-down? Please confirm that this is definitely the Items property. Also when you type box_Instructor.Selected. you should see the valid options underneath - what are they?

Thats correct. 

 

Items=SPInstructors.InstructorName

 

 

Below find a screenshot; also see the suggestion it is giving. Instructor Name is there as you can see, but it still gives me the error.

 

Screen Shot 2020-04-04 at 13.43.01.png

 

Thanks for your help!

Hi @tupues ,

It should be

SPInstructors.'Instructor Name'

 

Tried that, but it doesn't change anything unfortunately. I put InstructorName because it's the actual column name...

 

Thanks ever so much for the quick help!

OK @tupues ,

This really should not be hard - you simply need to match the output to the data type required at the target and this as you have mentioned is Text. It all comes down to getting a text value from the drop down, which should be easy if you refer to what the user selects, which is ddName.Selected.xxxx where xxxx can be Value for a Choice field, Result for a Distinct filter or (in your case) the name of the field presented.

I am sorry to ask this question again, but the Items property - is it

SPInstructors.InstructorName

as I said or

Items=SPInstructors.InstructorName

as you said 

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

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

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (46,026)