Use math calculations with a nested view

By: Jack Evangelides | Asked: 08/02/2022
ForumsCategory: General questionsUse math calculations with a nested view
Jack EvangelidesJack Evangelides asked 2 years ago
Is it possible to use a math calculation with a nested view?    ie. value from form B - value from form A   I have: [frm-stats id=143 type=total user_id=current decimal=2] --> Form A shortcode
[display-frm-data id=4437 pass_field="[140 show=ID]"] --> Nested shortcode from form B     I want to essentially use  [frm-math] [display-frm-data id=4437 pass_field="[140 show=ID]"] - [frm-stats id=143 type=total user_id=current decimal=2]  [/frm-math]   but it doesn't seem to work
Bobby Clapp replied 2 years ago

I think you have to figure out how to show the individual field. The frm-stats id is a field id and a value. The view id is related to the whole form. It really doesn't represent a specific field id and doesn't know how to evaluate it. That's my interpretation of the situation.

Victor Font replied 2 years ago

I think Bobby's right. Your solution may live in building your own short code to return the value you need.

Jack EvangelidesJack Evangelides replied 2 years ago

Thanks for the support, I actually realised that the nested view needed to be trimmed down, removing all access code (divs, p tags etc...) and just show an integer. Then when nesting it into the parent view, it worked how it should.

Bobby Clapp replied 2 years ago

Good call. Sometimes things require some self troubleshooting. Enjoy!

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community