cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ABK
Advocate I
Advocate I

Is there really no simple way to patch into a hyperlink field on SharePoint?

Hi there!

I'm trying to create a "Create" button that essentially only needs 4 properties to create an MainEvent.

 

Name

Date

Who created the event

A URL to a online picture to use for the event

 

The problem is i am using a "hyperlink" field for the picture and I can't get it to patch

 

 

If(
    MainEventNavnInput.Text = "";
    UpdateContext({msg_visible: false});;
    UpdateContext({msg_visible: true});
    Patch(
        MainEvent;
        Defaults(MainEvent);
        {
            MainID: Text(
                Value(
                    First(
                        Sort(
                            MainEvent;
                            Value(MainID);
                            Descending
                        )
                    ).MainID
                ) + 1
            );
            Titel: MainEventNavnInput.Text;
            MainDateCreated: DatePicker1.SelectedDate;
            Opretter: CurrentUser.FullName;
            PictureEvent: BilledeLinkInput.Text
            
        }
    )
)

 

 

Is there really no simple solution for setting an URL to PictureEvent from BilledeLinkInput.Text.

 

And if not, anyone care to help me learn more about how i create this flow? 🙂

4 REPLIES 4
Alex_10
Super User
Super User

@ABK 

if the the code you mentioned gives you "Invalid URL" error, that means you need to patch a valid url string (must start with http:// or https://)  

Patch(MainEvent, Defaults(MainEvent), {....., PictureEvent: "https://yourURL.xx"})

 

Hi @Alex_10 .

 

Thank you for replying. 

 

I am currently NOT getting any errors at all.

PictureEvent is a hyperlink field where there is a "URL address" and "alternate text" (translation might be a bit off, i'm danish).

 

If i remove "PictureEvent", the code works fine. 

I guess i am mostly baffled that there seems to be no direct way to patch to a hyperlink field in SharePoint without the use of flow.  

ganeshsanap
Super User
Super User

@ABK,

As per below blog post by @mdevaney, it should work for you with simple text input.

PATCH A SharePoint Hyperlink Column In Power Apps 

 

Example

Patch(
    Vendors,
    Defaults(Vendors),
    {
        Title: TextInput_Title.Text
        WebsiteHyperlink: TextInput_Website.Text
    }
)

Firstly, try passing simple URL like https://www.google.com


Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

 

Best Regards,

Ganesh Sanap

Blog site 

Hi @ganeshsanap 

 

I have tried simply modifying the code to 

 

If(
    MainEventNavnInput.Text = "";
    UpdateContext({msg_visible: false});;
    UpdateContext({msg_visible: true});
    Patch(
        MainEvent;
        Defaults(MainEvent);
        {
            MainID: Text(
                Value(
                    First(
                        Sort(
                            MainEvent;
                            Value(MainID);
                            Descending
                        )
                    ).MainID
                ) + 1
            );
            Titel: MainEventNavnInput.Text;
            MainDateCreated: DatePicker1.SelectedDate;
            Opretter: CurrentUser.FullName;
            PictureEvent: "https://www.google.com"
            
        }
    )
)

 

It still isn't adding a new event. 

As i said, if i delete "PictureEvent" from the code - it does. 

 

In SharePoint PictureEvent is set to "Link". If i change it to "picture" it does not change anything. 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,049)