Column Default Value Based on Root URL

%3CLINGO-SUB%20id%3D%22lingo-sub-1423485%22%20slang%3D%22en-US%22%3EColumn%20Default%20Value%20Based%20on%20Root%20URL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1423485%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20tab%20in%20an%20MS%20Teams%20team%20where%20users%20can%20view%20our%20upcoming%20corporate%20training%20sessions%20(i.e.%20Events).%20In%20each%20event%20description%2C%20I%20am%20putting%20a%20link%20to%20a%20sign%20up%20form.%20The%20sign%20up%20form%20is%20a%20list%20in%20MS%20SharePoint%20Online.%20In%20this%20list%2C%20there%20is%20a%20column%20to%20specify%20the%20event%20to%20which%20the%20user%20wants%20to%20sign%20up.%20I%20want%20this%20column%20to%20be%20automatically%20filled%20using%20the%20column%20default%20value%20function%20in%20SharePoint.%20The%20default%20value%20would%20be%20based%20on%20the%20root%20URL%20that%20led%20the%20user%20to%20the%20sign%20up%20form.%20For%20example%2C%20if%20the%20user%20was%20viewing%20training%20session%20X%20in%20Teams%2C%20it%20means%20the%20root%20URL%20is%20the%20event%20X%20URL.%20So%2C%20the%20formula%20would%20be%3A%20IF%20%5BRoot%20URL%5D%20%3D%20(URL%20of%20event%20X)%20then%20%22X%22%2C%20ELSEIF%20%5BRoot%20URL%5D%20%3D%20(URL%20of%20event%20Y)%20then%20%22Y%22...%20and%20so%20on.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EDoes%20this%20hypothetical%20%5BRoot%20URL%5D%20function%20even%20exist%3F%20If%20not%20do%20you%20have%20any%20suggestion%20for%20how%20I%20can%20tell%20which%20event%20the%20user%20is%20coming%20from%20such%20that%20I%20can%20fill%20the%20column%20automatically%3F%3CBR%20%2F%3EThanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1423485%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EColumn%20Default%20Value%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EColumns%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EDefault%20Value%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EEvents%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Eformula%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Emodern%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Formula%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1423654%22%20slang%3D%22en-US%22%3ERe%3A%20Column%20Default%20Value%20Based%20on%20Root%20URL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1423654%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F666161%22%20target%3D%22_blank%22%3E%40beshr1993%3C%2FA%3E%26nbsp%3B%3A%20This%20seems%20some%20what%20complex.%20If%20I%20understood%20yours%20query%2C%20check%20if%20below%20logic%20applies%20here%3A%3C%2FP%3E%3CP%3E1)%20If%20Root%20URL%20is%20fixed%20then%20you%20can%20add%20the%20value%20X%20as%20parameter%20for%20different%20events.%3C%2FP%3E%3CP%3E2)%20Use%20different%20list%20to%20save%20event%20URL%20and%20Event%20title%20and%20lookup%20that%20list%20based%20on%20selection%20of%20the%20root%20url.%20This%20will%20automatically%20pop%20up%20URL%20and%20title%20on%20the%20list%20column.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPlease%20let%20me%20know%20for%20any%20queries.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1502753%22%20slang%3D%22en-US%22%3ERe%3A%20Column%20Default%20Value%20Based%20on%20Root%20URL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1502753%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F679665%22%20target%3D%22_blank%22%3E%40Ashish_Kohale%3C%2FA%3E%26nbsp%3Bthank%20you%20very%20much%20for%20your%20super%20fast%20reply%20and%20sorry%20for%20mine%20being%20sooo%20late%3B%20I'd%20rolled%20out%20the%20ad%20hoc%20sign%20up%20system%20I%20had%20and%20got%20entangled%20in%20maintaining%20it%20daily.%20Now%20that%20I%20have%20some%20more%20time%2C%20I%20am%20going%20back%20to%20this%20to%20see%20if%20I%20can%20figure%20it%20out.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1)%20Yes%2C%20the%20root%20URL%20is%20fixed.%20It%20is%20saved%20as%20an%20event%20on%20SharePoint%20site%2C%20so%20that%20is%20clear.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2)%20You%20are%20saying%20that%20I%20should%20create%20another%20list%20with%20the%20URL%20of%20each%20event%20and%20its%20corresponding%20name%2C%20yes%3F%20So%20far%20so%20good.%20But%20then%20you%20are%20suggesting%20that%20in%20the%20event%20sign%20up%20list%2C%20the%20default%20value%20of%20the%20event%20name%20is%20a%20formula%20that%20takes%20the%20root%20URL%20and%20matches%20it%20with%20the%20URL-name%20list%20and%20returns%20the%20corresponding%20event%20name%20in%20that%20list%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20get%20the%20logic%20and%20it%20sounds%20like%20the%20solution%20to%20my%20problem.%20But%20I%20am%20not%20sure%20how%20to%3A%3C%2FP%3E%3CP%3Ea)%20the%20function%20to%20take%20the%20root%20URL%3C%2FP%3E%3CP%3Eb)%20the%20function%20to%20look%20up%20this%20source%20URL%20in%20another%20list%20on%20the%20same%20site%20and%20match%20the%20name%3C%2FP%3E%3CP%3ECan%20you%20please%20help%20me%20with%20these%20functions%3F%20Better%20even%2C%20can%20you%20please%20give%20me%20a%20hint%20of%20how%20the%20formula%20would%20look%20like%20in%20the%20default%20value%20field%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAgain%2C%20thanks%20a%20lot%20and%20sorry%20for%20your%20help%20the%20late%20response.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1515037%22%20slang%3D%22en-US%22%3ERe%3A%20Column%20Default%20Value%20Based%20on%20Root%20URL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1515037%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F666161%22%20target%3D%22_blank%22%3E%40beshr1993%3C%2FA%3E%26nbsp%3B%3A%20I%20think%20you%20can%20user%20REST%20api%20to%20get%20the%20data%20from%20another%20list%20and%20check%20the%20values%20on%20success%20of%20rest%20function%2C%20hope%20it%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1521025%22%20slang%3D%22en-US%22%3ERe%3A%20Column%20Default%20Value%20Based%20on%20Root%20URL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1521025%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F679665%22%20target%3D%22_blank%22%3E%40Ashish_Kohale%3C%2FA%3E%26nbsp%3BThank%20you%20for%20the%20suggestion.%20I%20will%20look%20into%20it%2C%20but%20first%20I%20must%20learn%20a%20bit%20of%20REST%20api%20because%2C%20I%20must%20admit%2C%20I%20know%20next%20to%20nothing%20about%20it%26nbsp%3B%3CSPAN%3E%3Agrinning_face_with_sweat%3A%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I have a tab in an MS Teams team where users can view our upcoming corporate training sessions (i.e. Events). In each event description, I am putting a link to a sign up form. The sign up form is a list in MS SharePoint Online. In this list, there is a column to specify the event to which the user wants to sign up. I want this column to be automatically filled using the column default value function in SharePoint. The default value would be based on the root URL that led the user to the sign up form. For example, if the user was viewing training session X in Teams, it means the root URL is the event X URL. So, the formula would be: IF [Root URL] = (URL of event X) then "X", ELSEIF [Root URL] = (URL of event Y) then "Y"... and so on.


Does this hypothetical [Root URL] function even exist? If not do you have any suggestion for how I can tell which event the user is coming from such that I can fill the column automatically?
Thanks.

4 Replies

@beshr1993 : This seems some what complex. If I understood yours query, check if below logic applies here:

1) If Root URL is fixed then you can add the value X as parameter for different events.

2) Use different list to save event URL and Event title and lookup that list based on selection of the root url. This will automatically pop up URL and title on the list column.

 

Please let me know for any queries.

 

 

@Ashish_Kohale thank you very much for your super fast reply and sorry for mine being sooo late; I'd rolled out the ad hoc sign up system I had and got entangled in maintaining it daily. Now that I have some more time, I am going back to this to see if I can figure it out.

 

1) Yes, the root URL is fixed. It is saved as an event on SharePoint site, so that is clear.

 

2) You are saying that I should create another list with the URL of each event and its corresponding name, yes? So far so good. But then you are suggesting that in the event sign up list, the default value of the event name is a formula that takes the root URL and matches it with the URL-name list and returns the corresponding event name in that list?

 

I get the logic and it sounds like the solution to my problem. But I am not sure how to:

a) the function to take the root URL

b) the function to look up this source URL in another list on the same site and match the name

Can you please help me with these functions? Better even, can you please give me a hint of how the formula would look like in the default value field?

 

Again, thanks a lot and sorry for your help the late response.

@beshr1993 : I think you can user REST api to get the data from another list and check the values on success of rest function, hope it helps.

@Ashish_Kohale Thank you for the suggestion. I will look into it, but first I must learn a bit of REST api because, I must admit, I know next to nothing about it :grinning_face_with_sweat: