uStore selection and database update

44 views
Skip to first unread message

john booth

unread,
Jun 26, 2025, 3:58:36 PMJun 26
to XMPie Interest Group
My XMPie just got updated. But here’s my issue.

Pre update: 
I have a product that is displayed in 2 steps (product ordering flow: multiple pages (legacy)). The first step, the user selects their product version from a dropdown list. Before the user goes to the second step, their selection is saved to the database. When arriving to the second step, there are input fields that are pre-populated by queries based on their selection from the first step. If needed, the user can up date these fields before moving on to the order confirmation.

Post update:
After the selection is made on step one, their value doesn’t make it to the database in time for the queries on step two to retrieve the proper values. So, step two’s input fields are blank.

Is it possible to added a JavaScript function to initiate (or force) the database update with the dropdown list selection before getting to step two’s?

couch

unread,
Jun 26, 2025, 10:46:38 PMJun 26
to XMPie Interest Group
I just setup a test document on uStore v25.1 using multipage (legacy) mode with two customization steps.
The first step has a drop-down with "branch" selection.
The second step has a text input field populated with the following custom SQL:

SELECT
CASE
  WHEN DialValue = 'South Boston' THEN '444-1234-5678'
  WHEN DialValue = 'Boston Downtown' THEN '555-1234-5678'
  WHEN DialValue = 'West Hartford' THEN '666-1234-5678'
  WHEN DialValue = 'Coral Gables, Miami' THEN '777-1234-5678'
  WHEN DialValue = 'Berkeley, CA' THEN '888-1234-5678'
  WHEN DialValue = 'Ann Arbor, MI' THEN '999-1234-5678'
  ELSE ''
END AS VALUE
FROM OrderProductDialValue
WHERE
  DialID = 25031 AND OrderProductID = @OrderProductID

You can see I'm setting static values rather than looking up from another table, but the result is the same. And obviously, you need to set the right id of the first dial.

Initially, it didn't work, but I edited the product again, and on the customization step that has the SQL, I checked the box "Override existing value (may override a value selected by the shopper and in reordering)" and then it worked as expected.

john booth

unread,
Jun 27, 2025, 12:20:18 PMJun 27
to XMPie Interest Group
My issue is that the data from the dropdown selection doesn’t make it to the database before I get to step two. 

Is it possible to get the value from the dropdown directly?

john booth

unread,
Jun 27, 2025, 4:09:00 PMJun 27
to XMPie Interest Group

I made too many changes to make this work.

I reverted back to when it last work and made these changes….

1. I moved the external database to the xmpie server.
2. In uStore, I went to presets>> data source setup and changed the reference to the new location of the database
3. My original query looked like this…

SELECT
    concat(fn1.[cardId], ' ', fn1.[region], ' - ', fn1.[attractionName]) AS [text],
    concat(fn1.[cardId], ' ', fn1.[region], ' - ', fn1.[attractionName]) AS [value],
    1 AS [ISDEFAULT]
FROM (
    SELECT
        opdv.DialValue AS [CityId]
    FROM
        [10.10.12.10\XMPIE].[uStore].[dbo].OrderProductDialValue opdv
        INNER JOIN [10.10.12.10\XMPIE].[uStore].[dbo].Dial_Culture dc ON (opdv.DialID = dc.DialID AND dc.CultureID = @CultureID)
    WHERE
        dc.FriendlyName = 'Card Version' AND
        opdv.OrderProductID = @OrderProductID
    ) main1
    CROSS APPLY getDataByCardID_fn(main1.CityId) fn1

I removed the reference to “[10.10.12.10\XMPIE]

4. Updated the data source in uProduce to point to the new location
5. made new proof and process number
6. Updated the product in uStore with the new numbers
7. In the customization wizard…
a. Updated the query
b. Made sure I selected the right data source
c. Turned on the ‘override existing value’

And that seemed to fix it.

Thanks for the help.
Reply all
Reply to author
Forward
0 new messages