Hi all,
I’ve been following the Power-up: Search bar with suggestions tutorial, but I can’t get it to link to the correct pages within the app – all of the displayed search options just link to one single product page. Any help on this would be greatly appreciated.
Here’s a summary of what I’ve done so far
-
Created an app variable “antimicobials” with the product information
-
On Ampicillin product page, created a page parameter “antimicrobial_id”
-
On the search page, created page variable “search_text”
-
On the search page, placed an input field and set the value equal to the page variable “search_text”
-
On the search page, placed a container with a text field inside of it and repeated it with the formula
SLICE(SELECT(appVars.antimicrobials,CONTAINS(LOWERCASE(item.name),LOWERCASE(pageVars.search_text))),0,4
Then, bound the value of the paragraph to the product name. (I’m wondering if there’s an issue here since mine states “incompatible” and “object with two properties is not assignable to type text / number”
-
Bound container visibility from #5 to the following formula
!IS_EMPTY(pageVars.search_text) -
Added open page logic for the search box, chose the “Ampicillin” page as the target. When I set the product_id to current_id – I get the same incompatible text (the type “objective with 2 properties” is not assignable to the type “text”)
-
The video doesn’t go into detail but at 0:43 they talk about setting the page variable on the product page. On the Ampicillin page, I created a page variable “selected_product”
In the logic section, I put in a set page variable function and set the variable name to “selected_product” and assigned the value as the following formula
FIND(appVars.antimicrobials,params.antimicrobial_id==item.id)
It shows the error – Object type is not assignable to text type
When I try to use the search bar, it is hidden until I start to type, it brings up the names defined in my app variable list but all selections link to the Ampicillin product page.
Does anyone know how I can get the pages to link appropriately?
Thanks!