cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

 

24 REPLIES 24


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

 

SPInstructors.InstructorName

 

 


It is the above.

 

I know, that's why I am puzzled by the error I am getting...

OK @tupues ,

Some trouble shooting - put a value in the box and put this on a button

ClearCollect(colTest,box_Instructor.Selected)

The go to View > Collections and see what is in colTest

 

I get the name selected.

 

(your help is awesome by the way 🙂 )

Yes, but what is the column name?

The name is "InstructorName" (without the quotes)

OK @tupues ,

This is getting weird.

Two things, put a label on the screen with the Text property 

box_Instructor.Selected.InstructorName

and see if it gives a value when you put input into the box.

Secondly out of desperation rather than anything else, try

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: col_Submit.Instructor.InstructorName
       }
   )
);

 


@WarrenBelz wrote:

OK @tupues ,

This is getting weird.

Two things, put a label on the screen with the Text property 

 

 

box_Instructor.Selected.InstructorName

 

 

 

This gives me the Name as selected in the dropdown...

 

Secondly out of desperation rather than anything else, try

 

 

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: col_Submit.Instructor.InstructorName
       }
   )
);

 

 

 


Results in the error below...

 

Screen Shot 2020-04-04 at 15.34.29.png

OK @tupues ,

I probably should have re-confirmed this before - what is the field type Instructor in your data source?

That's a single line of text.

Ok - looking at colSubmit - run this by itself and send me a screenshot of the Instructor field (in View > Collections)

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 Solution Authors
Top Kudoed Authors
Users online (9,060)