Hiding certain form details to particular user - formsflow.ai

Can i design my form in such a way that can hide certain details to particular user?or visible only to reviewer side and not visible for client user

Yes, it is possible to hide certain fields from a particular category of members. In the open-source project of formsflow.ai, they are giving 2 sample forms
FOI and New business Licence in that itself they are using this feature. In that, the reviewer section of the FOI form is available only at the reviewer side and I will attach the code for the same here
const UserDetails = JSON.parse(localStorage.getItem("UserDetails"))
const groups = UserDetails["groups"]
if(groups.includes("/formsflow/formsflow-reviewer") && data.applicationStatus==="New") {
show = true;
}
else {
show = false;
}
Also, you can design the form as per your requirements by giving conditions while designing the form

Related

I want to add Share to Slack feature in my web app. Facing issue in showing the popup to select the receipients

I am adding share to slack functionality in my web app.
But I cannot find any solution by which I can show my app users to select a user/channel or team in slack to share the content with.
I have added Sharing on Teams also. In that I am able to select the users or search the particular user. Please refer the below link to see how it is looking in teams.
https://learn.microsoft.com/de-de/power-bi/collaborate-share/media/service-share-report-teams/service-teams-share-to-teams-dialog.png
I want to know, is there any way by which we can implement the sharing to particular user or channel etc on slack same as it is there in teams.
Thanks.
Once the Web app shares content, it's very much up to the receiving app to decide what it makes of the incoming data.
try {
await navigator.share({
title: 'Title',
text: 'Text',
url: 'https://example.com/',
});
console.log('Successful share'))
} catch (err) {
console.log('Error sharing', err));
}
Possible values are:
url: A string representing a URL to be shared.
text: A string representing text to be shared.
title: A string representing a title to be shared. May be ignored by the target.
See the bold part. Try populating text and title differently and see if it makes any difference.

Laravel - Different $URL after verification Email

In my app, there are two types of users. A group of them, as admins, must register themselves, and the other can only be present after being invited by the admins. Both types of users get verification email. I want the page that these two types of users see, after click on button in verification email, is different. How can I do this?
Thanks for any help
If You are using laravel/ui for authentication you need to provide path where the user is to be taken based on type in your VerificationController which ensure where to redirect your user after it is verified.
you need to remove protected $redirectTo = RouteServiceProvider::HOME; and replace with below function
public function redirectTo()
{
if(auth()->user()->type == 'admin'){
return '/here';
}else{
retuurn 'there'
}
}
if you are using anything other than laravel/ui you can follow the same procedure and have to redirect manually to certain url

Perform extra validation after a Student signs into Moodle

I am hoping someone can point me in the right direction. We host a University Moodle site and we are looking for a way in which we can perform extra validation on a Student whenever they login. I will give a scenario.
We have an endpoint with a list of email addresses of students allowed to use the system, for example a list of Students who are fully paid up on tuition. Therefore, we are looking for a way to hook into the login process, perform this check and the allow the student to continue or redirect back to the login page with an error.
I would appreciate any advice on how we can achieve this. Thank you.
I found a solution to my problem. I ended up creating a custom Authentication plugin using the guidelines from https://docs.moodle.org/dev/Authentication_plugins. With that knowledge, I used the copied the folder in the Moodle installation path auth/none and used that as a shell for my new plugin. I went ahead and customized the plugin names to what I needed. Once that was done and once the plugin was installed and enabled from the Administrator Dashboard, I had something like this in my auth.php file:
// Required for all auth plugins
public function user_login($username, $password)
{
return false;
}
// Hooks in immediately after the User submits the login form
public function loginpage_hook()
{
$username = $_REQUEST['username'] ?? '';
/** CODE CHECKING IF USERNAME IS ALLOWED TO ACCESS MOODLE **/
/** FOR EXAMPLE CHECK IF USER PAID FEES **/
$userHasPaidFees = api_checks_if_user_paid_fees($username);
if ($userHasPaidFees ) {
// Returning true here proceeds with the
// normal Username/Password login combination
return true;
}
// If not, redirect them back to Login
// Or any other page and notify
redirect(
new moodle_url('/login/index.php'),
'Message telling user why they were not able to sign in',
null,
\core\output\notification::NOTIFY_ERROR
);
}
Thanks and I hope someone finds this useful.

Is there a way to conditionally block a referer in Google Tag Manager?

We have an issue with GA where conversion sources are being lost after a user clicks on a link to our site, goes to the site, and then logs in using Facebook.
My understanding from GTM tips - implement referral exclusions is that our site sees the document.referrer as coming from Facebook and starts a new session, losing the original referrer. If we know the landing page on our site the user sees after logging into Facebook, is it possible to add code to exclude the FB referrer only for that page? I.e, on that one page we have something like (from the linked article):
function() {
var referrals = [
'facebook.com'
];
var hname = new RegExp('https?://([^/:]+)').exec({{Referrer}});
if (hname) {
for (var i = referrals.length; i--;) {
if (new RegExp(referrals[i] + '$').test(hname[1])) {
return null;
}
}
}
return {{Referrer}};
}
We can't simply add facebook.com to the GA exclusion list, as we have campaigns running on Facebook as well, so we'd still need visibility to organic traffic coming from Facebook.
You can copy GA tag and modify the copy with this code. Then fire that copy only on pages where you need to block referrer and block original GA tag on same pages.
If you don't want to have multiple GA pageview tags then use Lookup Table variable based on page paths. For some pages this variable should return your code as a Custom JavaScript variable and a default value should be {{Referrer}}.

Google DFP: set custom data and reuse them with javascript

Is possible to set custom data on a DFP ad creative, in the console panel, and then reuse them on the front end of your web site?
For example let say I have an ad, that have a list of creatives.
Depending on the creative it is displaying, which has a custom field with a number. With javascript I want to read this number on my web page, and do different actions depending on (change title of document or activate an app related to the DFP).
More over is possible to display in an Ad a custom js application (ex. a calculator) which the user can interact with it?
I didn't manage to find a way to extract creative's custom fields via javascript. Most likely it's not exposed on the page because it's been designed for a slightly different purpose:
These optional fields can be used to organize objects in reports. They're created in the "Admin" tab. They don't affect ad serving or delivery
But you can do it differently in a number of ways:
bind to creative IDs - if a particular creative id is shown do some actions of your choice. These IDs are available in your DFP 'creatives' grid.
if you're not limited to image creatives you can use 3rd party creatives with a js code that would communicate to the parent page and pass some data to your js handler installed on the parent page. As DFP uses friendly iframes (http://www.iab.net/media/file/rich_media_ajax_best_practices.pdf) you do have access to the parent page from inside your ad
A dirtier approach - you can put some service data into the alt field which is reachable inside the ad from the parent page
There's also an attribute event.labelIds available in the event handler but it's empty despite some labels associated with my testing creative
Here's the code illustrating p.1 and p.3:
googletag.pubads().addEventListener('slotRenderEnded', function(event) {
if (!event.isEmpty) {
var slotId = event.slot.getSlotElementId();
var iframe = document.querySelector('#' + slotId + ' iframe');
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
var img = iframeDoc.querySelector('img');
if (img && img.alt) {
console.log('Got alt: ' + img.alt);
}
if (event.creativeId) {
console.log('Got creative id: ' + event.creativeId);
}
}
});
Here it is live: https://jsfiddle.net/50b4npw8/
You can find some additional info on GPT events here